# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=psautohint
pkgver=2.4.0
pkgrel=3
pkgdesc="standalone version of AFDKO's autohinter"
url="https://github.com/adobe-type-tools/psautohint"
arch="all !s390x" # ufo2ft
license="Apache-2.0"
depends="
	py3-fonttools
	py3-fs
	py3-lxml
	python3
	"
makedepends="
	py3-gpep517
	py3-installer
	py3-setuptools_scm
	py3-wheel
	python3-dev
	"
checkdepends="py3-pytest py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="https://github.com/adobe-type-tools/psautohint/releases/download/v$pkgver/psautohint-$pkgver.tar.gz"
options="!check" # fail for some reason

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	PYTHONPATH="$(echo build/lib.linux*)" \
	pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/psautohint-*.whl
}

sha512sums="
e690794630d5ad178c708f15d150870b33a03a20051ed3f8b85c48b2f24cac4455561303ca4d7344a76b48c737eb06ca0b09d44d129ae3e1ea8ee43c3bb8ee04  psautohint-2.4.0.tar.gz
"
